<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="Bookmark" href="/favicon.ico">
	<link rel="Shortcut Icon" href="/favicon.ico" />
	<!--[if lt IE 9]>
	<script type="text/javascript" src="__UU__/lib/html5.js"></script>
	<script type="text/javascript" src="__UU__/lib/respond.min.js"></script>
	<script type="text/javascript" src="__UU__/lib/PIE_IE678.js"></script>
	<![endif]-->
	<link href="__UU__/css/H-ui.min.css" rel="stylesheet" type="text/css" />
	<link href="__UU__/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
	<link href="__UU__/lib/Hui-iconfont/1.0.6/iconfont.css" rel="stylesheet" type="text/css" />
	<link href="__UU__/css/style.css" rel="stylesheet" type="text/css" /> 
	
	<!--[if IE 6]>
	<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
	<script>DD_belatedPNG.fix('*');</script>
	<![endif]-->
	<title>添加</title>
	<style>
	.in-label label.evfp{
		border-color: orange;
		background: #FFF;
	}
	</style>
</head>
<body>
	<div class="pd-20">
		<div class="lable_search" style="margin-bottom: 20px;">
			<label>搜标签：</label>
			<input type="text" name="" id="keyd" class="input-text" placeholder="输入标签名" />
		</div>
			<div class="in-label">
			<volist name="list" id="vo">
				<label <if condition="in_array($vo['id'],$idarraylist)">class="current"</if>><input type="checkbox" name="" value="{$vo.id}_{$vo.name}" <if condition="in_array($vo['id'],$idarraylist)">checked="checked"</if>>{$vo.name}</label>
			</volist>
			</div>

			<div class="mt-20 text-c">
				<button type="button" class="btn btn-danger radius" id="enter"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
			</div>
	</div>
<script type="text/javascript" src="__UU__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__UU__/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__UU__/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="__UU__/js/H-ui.js"></script>
<script type="text/javascript" src="__UU__/js/H-ui.admin.js"></script>	
<script>
$(function (){
	$('.in-label').on('click','label',function (){
		if( $(this).find( 'input[type=checkbox]' ).get(0).checked ){
			$(this).addClass('current');
		}else{
			$(this).removeClass('current');
		}
	});

	$('#enter').click( function (){
		var box = $('.in-label input[type=checkbox]');
		var arr = [];
		box.each(function (i,item){
			if( item.checked )
				arr.push(item.value);
		});
		 if( arr.length < 1 ){
		 	layer.msg("请选择标签");
		 	return ;
		 }
		window.parent.interestCallback(arr);
		layer_close();
	});


	// 搜索标签
$('#keyd').keyup(function() {
	var v = $(this).val(),
		that = $(this);
	if( $.trim(v) ){
		$('.in-label label').each(function(index,item) {
			var t = $.trim($(this).text());
			if( t.indexOf(v) != -1 ){
				$(this).addClass('evfp');
			}else{

				$(this).removeClass('evfp');
			}
		});
	}
	
}); 


});
</script>
</body>
</html>
